import React, { useEffect, useState } from "react";
import { ipcRenderer } from "electron";
import axios from "axios";

const App = () => {
  const [state, setState] = useState(null);
  useEffect(() => {
    axios
      .get("http://localhost:3000/app/name/11")
      .then((data) => {
        setState(data.data);
      })
      .catch((err) => {});
    ipcRenderer.send("play", "play:que1");
    ipcRenderer.on("play", (event, arg) => {
      console.log(arg);
    });
    return () => {
      ipcRenderer.removeAllListeners("play");
    };
  }, []);
  return <div>hello{state}</div>;
};
export default App;
